<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="col-sm-12 select-info">
			<form id="role-form">
				<div class="select-list">
					<ul>
						<li>
							电影标题：<input type="text" name="movieTitle"/>
						</li>
						<li>
							电影评分：<input type="text" name="movieScore"/>
						</li>
						<li>
							备注：<input type="text" name="remark"/>
						</li>
						<li>
							电影状态：<select name="movieState">
							<option th:value="0">所有</option>
							<option   th:value="1">审核中</option>
							<option   th:value="2">审核通过</option>
							<option   th:value="3">未审核</option>
							<option   th:value="4">审核未通过</option>
							<option   th:value="5">已上架</option>
							<option   th:value="6">未上架</option>
						</select>
						</li>
						<li class="select-time">
							<label>电影上映时间： </label>
							<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[movieRelesdate]"/>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i>&nbsp;导出</a>
						</li>
					</ul>
				</div>
			</form>
		</div>
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:movie:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="module:movie:remove">
				<i class="fa fa-trash-o"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('module:movie:edit')}]];
        var removeFlag = [[${@permission.hasPermi('module:movie:remove')}]];
        var shangjias = [[${@permission.hasPermi('module:movie:shangjia')}]];
        var xiajias = [[${@permission.hasPermi('module:movie:xiajia')}]];
        var datass = [[${@dict.getType('sys_shenhe')}]];
        var prefix = ctx + "module/movie"

        $(function() {
            var options = {
                url: prefix + "/list",
                shangUrl:prefix+"/shangjia/{id}",
                xiajia:prefix+"/xiajia/{id}",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                showExport: false,
                modalName: "电影",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'movieId', 
					title : '电影的编号' 
				},
				{
					field : 'movieTitle', 
					title : '电影标题' 
				},
				{
					field : 'movieInfo', 
					title : '电影信息' 
				},
				{
					field : 'movieScore', 
					title : '电影评分' 
				},
				{
					field : 'movieUrl', 
					title : '电影的地址' 
				},
				{
					field : 'movieFilename', 
					title : '电影名称' 
				},
				{
					field : 'movieImgurl', 
					title : '图片的地址' 
				},
				{
					field : 'movieImgname', 
					title : '图片名称' 
				},
				{
					field : 'movieRelesdate', 
					title : '电影上映时间' 
				},
				{
					field : 'movieState',
					title : '电影状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datass, value);
                    }
				},
				{
					field : 'remark', 
					title : '备注' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.movieId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.movieId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        function shangjia(id) {
            var url = "/module/movie/shangjia";
            $.ajax({
                url:url,
                data:"id="+id,
                dataType:"JSON",
                type:"POST",
                success:function (data) {
                    if(data!=null){
                        $.modal.confirm(data);
                    }
                }

            });

        }
    </script>
</body>
</html>